<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>挂靠公司详细信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
    <div class="Wrapper">
        <div>
            <div id="pageInTab" class="pageInTab">
                <div tabid="tabA" title="详细信息" lselected="true">
                    <form id="formSet1">
                        <div class="fieldset1 tabel_col clearFix">
                            <div class="caption">
                                <span class="title">详细信息</span>
                            </div>
                            <div class="fieldBox col_33">
                                <div class="label">公司名称</div>
                                <div class="field">
                                     <span id="lnkCompNm" name="lnkCompNm">&nbsp;</span>
                                </div>
                            </div>
                            	    <div class="fieldBox col_33">
				                    <div class="label">组织机构代码</div>
				                    <div class="field">
				                     <span id="orgCode" name="orgCode">&nbsp;</span>
				                    </div>
		               		 </div>
                            <div class="fieldBox col_33">
                                <div class="label">公司归属</div>
                                <div class="field">
                                	 <span id="ownerCdNm" name="ownerCd">&nbsp;</span>
                                </div>
                            </div>
                              <div class="fieldBox col_100">
                                <div class="label">所在地</div>
                                <div class="field">
                                    <span id="officeAddr" name="officeAddr">&nbsp;</span>
                                </div>
                            </div>
                              <div class="fieldBox col_100">
                                <div class="label">主营项目类别</div>
                                <div class="field">
                                    <span id="majorBiz" name="majorBiz">&nbsp;</span>
                                </div>
                            </div>
                             <div class="fieldBox col_33">
                                <div class="label">企业类型</div>
                                <div class="field">
                                    <span id="compTyp" name="compTyp">&nbsp;</span>
                                </div>
                            </div>
                               <div class="fieldBox col_33">
                                <div class="label">营业执照注册号</div>
                                <div class="field">
                                    <span id="bizLicNo" name="bizLicNo">&nbsp;</span>
                                </div>
                            </div>
                                 <div class="fieldBox col_100">
                                <div class="label">注册地址</div>
                                <div class="field">
                                    <span id="regAddr" name="regAddr">&nbsp;</span>
                                </div>
                            </div>
                            <div class="fieldBox col_33">
                                <div class="label">成立日期</div>
                                <div class="field">
                                    <span id="regDt" name="regDt">&nbsp;</span>
                                </div>
                            </div>
                               <div class="fieldBox col_33">
                                <div class="label">税务登记号</div>
                                <div class="field">
                                    <span id="taxRegNo" name="taxRegNo">&nbsp;</span>
                                </div>
                            </div>
                              <div class="fieldBox col_33">
                                <div class="label">道路运输许可证有效期</div>
                                <div class="field">
                                    <span id="expDt" name="expDt">&nbsp;</span>
                                </div>
                            </div>
                               <div class="fieldBox col_100">
                                <div class="label">经营范围</div>
                                <div class="field">
                                    <span id="bizScope" name="bizScope">&nbsp;</span>
                                </div>
                            </div>
                               <div class="fieldBox col_33" rlPsnDiv="zk">
                                <div class="label">法人代表</div>
                                <div class="field">
                                    <span id="corpRep" name="corpRep">&nbsp;</span>
                                </div>
                            </div>
                            <div class="fieldBox col_33" rlPsnDiv="zk">
                                <div class="label">法人身份证号</div>
                                <div class="field">
                                    <span id="idNo" name="idNo">&nbsp;</span>
                                </div>
                            </div>
                              <div class="fieldBox col_33">
                                <div class="label">现累计挂靠数量</div>
                                <div class="field">
                                    <span id="totLnkQty" name="totLnkQty">&nbsp;</span>
                                </div>
                            </div>
                             <div class="fieldBox col_33">
                                <div class="label">自有车辆备案数量</div>
                                <div class="field">
                                    <span id="ownQty" name="ownQty">&nbsp;</span>
                                </div>
                            </div>
                             <div class="fieldBox col_33">
                                <div class="label">在我司累积挂靠车辆</div>
                                <div class="field">
                                    <span id="ourTotLnkQyt" name="ourTotLnkQyt">&nbsp;</span>
                                </div>
                            </div>
                                       <div class="fieldBox col_33" rlPsnDiv="zk">
                                <div class="label">实际控制人</div>
                                <div class="field">
                                    <span id="actCtrlNm" name="actCtrlNm">&nbsp;</span>
                                </div>
                            </div>
                             <div class="fieldBox col_33" rlPsnDiv="zk">
                                <div class="label">实际控制人手机号码</div>
                                <div class="field">
                                    <span id="actCtrlMp" name="actCtrlMp">&nbsp;</span>
                                </div>
                            </div>
                            <div class="fieldBox col_33" rlPsnDiv="zk">
                                <div class="label">联系人</div>
                                <div class="field">
                                    <span id="lnkNm" name="lnkNm">&nbsp;</span>
                                </div>
                            </div>
                             <div class="fieldBox col_33" rlPsnDiv="zk">
                                <div class="label">联系人手机号码</div>
                                <div class="field">
                                    <span id="lnkMp" name="lnkMp">&nbsp;</span>
                                </div>
                            </div>
                            <div class="fieldBox col_33" rlPsnDiv="zk">
                                <div class="label">联系人职务</div>
                                <div class="field">
                                    <span id="lnkPost" name="lnkPost">&nbsp;</span>
                                </div>
                            </div>
                              <div class="fieldBox col_33">
                                <div class="label">审核状态</div>
                                <div class="field">
                                    <span id="audStsCdNm" name="audStsCdNm">&nbsp;</span>
                                </div>
                            </div>
                             <div class="fieldBox col_100">
                                <div class="label">备注</div>
                                <div class="field">
                                <textarea name="rem" id="rem"  rows="4"  class="ui-textarea l-textarea" style="width:72%"  value=""  readonly="readonly" >
                                </textarea>
                                </div>
                            </div>
                            </div>
                            <div class="fieldBox col_100" style="display:none;">
								<div class="field">
								    <input name="lnkCompId"  id="lnkCompId" type="text" class="ui-textbox" value="${id}">
								</div>
							</div>
					<div class="fieldBox col_100"  id="psnDiv"  style="display:none">
				            <div class="sqPanel">
				                <div class="sqPanel_head inL">
				                    <span>主要人员信息</span>
				                </div>
				                 <br/>
				                  <br/>
				                <div id="psnGrid">
				                    <div id="ligergrid_psn" class="sq-grid"></div>
				                </div>
				            </div>
				        </div>
				 <div class="fieldBox col_100" id="fileModify">
	                    <div class="label">资料</div>
	                    <div class="field">
	                    	<jsp:include page="../../system/sysUlFilesRec/sysUlFileRecListDetail.jsp" flush="true" >
	                    		<jsp:param name="pkId" value="${id}"/>
	                    		<jsp:param name="tabNm" value="PRJ_LNK_COMP"/>
	                    	</jsp:include>
	                    </div>
	                </div>
                    </form>
                        </div>
               <div tabid="tabB" title="相关项目" id="tabBId" >
                    <iframe frameborder="0" name="tabB" id="tabB" src=""></iframe>
          		 	</div>
               <div tabid="tabC" title="变更记录" id="tabCId" >
                    <iframe frameborder="0" name="tabC" id="tabC" src=""></iframe>
          		 	</div>
          	   <div tabid="tabD" title="备案账号" id="tabDId" >
                    <iframe frameborder="0" name="tabD" id="tabD" src=""></iframe>
          		 	</div>
                <div tabid="tabE" title="人工干预" id="tabEId">
                    <iframe frameborder="0" name="tabE" id="tabE" src=""></iframe>
                </div>
                <!-- 17-8-9 by YAOXIURONG -->
          <!--      <div tabid="tabC" title="流程权限列表" id="tabCId" >
                    <iframe frameborder="0" name="tabC" id="tabC" src=""></iframe>
          		 	</div> -->
                </div>
                </div>
            </div>
    </div>

<script type="text/javascript">
var pageInApp={
		flag:true
};
var rlPsnListPage;
var buOrgCd ='${buOrgCd}';
var rlPsnGrid;
//if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
	   if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_XNY){s
        	$("#psnDiv").hide();
        }else{
            $("#psnDiv").show();
        }
// }
var pageInTab = null;
var loadedTabs=[]
$(function () {
	initData();
	initTab();
	if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
	//	pageInTab.removeTabItem("tabC");
		//pageInTab.removeTabItem("tabD");
		$("div[rlPsnDiv='zk']").each(function(){
			$(this).hide();
		 });
	}else{
		$("div[rlPsnDiv='zk']").each(function(){
			$(this).hide();
		 });

	}
	if($("#rem")&&$("#rem")!="undefined"){
		$("#rem").setDisabled_ligerTextarea(true);
	}
});
	//初始化数据
	function initData(){
		var lnkCompId = $("#lnkCompId").val();
    	if(!lnkCompId)return;
    	var _url = '<%=path%>/project/prjlnkcomp/getById.do';
    	$.ajax({
    		type: 'get',
    		dataType:'json',
    		data:{id:lnkCompId},
    		url: _url,
    		success:function(msg){
    			 if(msg.success == 1){
    				 setData(msg.data);//设置数据
    				 rlPsnListPage = msg.data.rlPsnListPage;
    				 initRlPsnGrid(rlPsnListPage);
    			 }else{
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
    			 }
    		}
    	});
	}

	//初始化Tab
	function initTab(){
		 pageInTab = $("#pageInTab").ligerTab({
	         height: 'auto',
	         contextmenu: false,
	         minIframeHeight: GET_minIframeHeight(),
	/*          onBeforeSelectTabItem: function (tabid) {
	         	var lnkCompId = $("#lnkCompId").val();
	         	 if(tabid!="tabA"){
		             	if(pageInApp.flag){
		                	top.$.ligerDialog.SQalert({content: LogUtils.LOG_LNK_COMP_SELECT_BEFORE, SQ_type: "warning"});
		                	return false;
		                }
	         	}
	         }, */
	         onAfterSelectTabItem: function(tabid) {
	          //   if (loadedTabs.indexOf(tabid)<0) {
	           var lnkCompId = $("#lnkCompId").val();
	             	 if(tabid!="tabA"){
		                	if(lnkCompId==null||lnkCompId==''){
		                		 top.$.ligerDialog.SQalert({content: LogUtils.LOG_LNK_COMP_SELECT_BEFORE, SQ_type: "warning"});
		                         return false; //验证不通过，不执行以下代码
		                	}
	             	}
	                 loadedTabs.push(tabid);
	                 switch (tabid){
	                     case "tabB":
	                    	    var lnkCompId = $("#lnkCompId").val();
	                         pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjbscinfo/toPrjBscInfoListPage.do?lnkCompId="+lnkCompId+"&&isLnkCompFlag=0"+"&isLnkPrjViewFlag=1");
	                         break;
	                     case "tabC":
	                    	    var lnkCompId = $("#lnkCompId").val();
	                         pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjLnkCompApply/prjCompApplyProcessPage.do?linkId="+lnkCompId+"&&isLnkCompFlag=0"+"&isLnkPrjViewFlag=1");
	                         break;
	                     case "tabD":
	                    	    var lnkCompId = $("#lnkCompId").val();
	                    	    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjLnkCompBkAcc/toListPageDetail.do?compId="+lnkCompId );
	                         break;
                         case "tabE":
                             var lnkCompId = $("#lnkCompId").val();
                             pageInTab.setTabItemSrc(tabid, "<%=path%>/customer/cstManualRelation/toListPage.do?Id=" + lnkCompId +"&useType=3&cstType=2");
                             break;
	                 }
	        //     };
	             SetIframe_height();
	         }
	     });

	     $.extend(true, pageInApp, {
	         pageInTab: pageInTab
	     });
	     /*if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){

	 		 $("#tabDId").hide();
	 		}*/
	};

	//初始化Tab
	function initZKTab(){
		 pageInTab = $("#pageInTab").ligerTab({
	         height: 'auto',
	         contextmenu: false,
	         minIframeHeight: GET_minIframeHeight(),
	/*          onBeforeSelectTabItem: function (tabid) {
	         	var lnkCompId = $("#lnkCompId").val();
	         	 if(tabid!="tabA"){
		             	if(pageInApp.flag){
		                	top.$.ligerDialog.SQalert({content: LogUtils.LOG_LNK_COMP_SELECT_BEFORE, SQ_type: "warning"});
		                	return false;
		                }
	         	}
	         }, */
	         onAfterSelectTabItem: function(tabid) {
	          //   if (loadedTabs.indexOf(tabid)<0) {
	           var lnkCompId = $("#lnkCompId").val();
	             	 if(tabid!="tabA"){
		                	if(lnkCompId==null||lnkCompId==''){
		                		 top.$.ligerDialog.SQalert({content: LogUtils.LOG_LNK_COMP_SELECT_BEFORE, SQ_type: "warning"});
		                         return false; //验证不通过，不执行以下代码
		                	}
	             	}
	                 loadedTabs.push(tabid);
	                 switch (tabid){
	                     case "tabB":
	                    	    var lnkCompId = $("#lnkCompId").val();
	                         pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjbscinfo/toPrjBscInfoListPage.do?lnkCompId="+lnkCompId);
	                         break;
	                     case "tabB":
	                    	    var lnkCompId = $("#lnkCompId").val();
	                    	    pageInTab.setTabItemSrc(tabid, "<%=path%>/bizflow/sysBizFlowRl/toAddPage.do?saveBizFlowRl=${saveBizFlowRl}&tabNm=PRJ_LNK_COMP&codeGrpCd=FLW0001&dataId=" + lnkCompId );
	                         break;
                         case "tabE":
                             var lnkCompId = $("#lnkCompId").val();
                             pageInTab.setTabItemSrc(tabid, "<%=path%>/customer/cstManualRelation/toListPage.do?Id=" + lnkCompId +"&useType=3&cstType=2");
                             break;
	                 }
	        //     };
	             SetIframe_height();
	         }
	     });

	     $.extend(true, pageInApp, {
	         pageInTab: pageInTab
	     });
	     /*if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){

	 		 $("#tabDId").hide();
	 		}*/
	};

	//设置页面数据
    function setData(data){
    	$("#lnkCompNm").html(data.lnkCompNm);//公司名称
    	$("#ownerCdNm").html(data.ownerCdNm);//公司归属
    	$("#officeAddr").html(data.officeAddr);//所在地
    	$("#majorBiz").html(data.majorBiz);//主营项目类别
    	$("#compTyp").html(data.compTyp);//企业类型
    	$("#bizLicNo").html(data.bizLicNo);//营业执照注册号
    	$("#regAddr").html(data.regAddr);//注册地址
    	$("#taxRegNo").html(data.taxRegNo);//税务登记号
    	$("#orgCode").html(data.orgCode);//组织机构代码
    	$("#bizScope").html(data.bizScope);//经营范围
    	$("#corpRep").html(data.corpRep);//法人代表
    	$("#idNo").html(data.idNo);//法人身份证号
    	$("#totLnkQty").html(data.totLnkQty);//现累计挂靠数量
    	$("#ownQty").html(data.ownQty);//自有车辆备案数量
    	$("#ourTotLnkQyt").html(data.ourTotLnkQyt);//在我司累积挂靠车辆
     	$("#lnkNm").html(data.lnkNm);//联系人
    	$("#lnkMp").html(data.lnkMp);//联系人手机号码
    	$("#actCtrlNm").html(data.actCtrlNm);//实际控制人
    	$("#actCtrlMp").html(data.actCtrlMp);//实际控制人手机号码
    	$("#lnkPost").html(data.lnkPost);//联系人职务
    	$("#audStsCdNm").html(data.audStsCdNm);//审核状态
    	$("#rem").text(data.rem==null?"":data.rem);//备注
    	$("#orgCode").text(data.orgCode);//组织机构代码
    	if(data.expDt){
    	var expDt = DateUtils.formatDate(new Date(data.expDt),DateUtils.YYYY_MM_DD);
    	$("#expDt").html(expDt);//道路运输许可证有效期
    	}
    	if(data.regDt){
    	var regDt = DateUtils.formatDate(new Date(data.regDt),DateUtils.YYYY_MM_DD);
    	$("#regDt").html(regDt);//注册日期
    	}

	};

	function initRlPsnGrid(data){
		rlPsnGrid = $("#ligergrid_psn").ligerGrid({
			data:data,
	        columns: [
	            { display: '姓名(*)', name: 'rlNm', minWidth: 60 },
	            { display: '联系人类型(*)', name: 'rlTypCdNm', minWidth: 60 },
	            {display: '股比',name:'stockRatio',width:100},
	            { display: '证件类型(*)', name: 'certTypCdNm', minWidth: 60 },
                { display: '证件号码(*)', name: 'certNo', width: 140,align:'left'},
   	            { display: '联系电话(*)', name: 'tel', width: 100,align:'left' },
   	            { display: '备注', name: 'rlRem', minWidth: 140 },
	        ],
	        pageSize:100,
	        root:'rows',
	        record:'total',
	        hideLoadButton : true,
	        heightDiff:-2,
	        checkbox:false,
	        enabledEdit: false,
	        allowUnSelectRow: true,
	        alternatingRow: false,
	        rownumbers:true,
	        enabledSort: false,
	        usePagerOnLessPagesize: false,
	    });
		  rlPsnGrid.setHeight(200);
	}

    </script>
</body>
</html>
